<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
    <h:head>
        <link rel="shortcut icon" href="/WebJpa/favicon.ico" type="image/x-icon"/> 
        <link rel="icon" href="/WebJpa/favicon.ico" type="image/x-icon"/> 
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title><ui:insert name="title">Default Title</ui:insert></title>
        <h:outputScript name="init.js" />
    </h:head>
    <link type="text/css" rel="stylesheet" href="/WebJpa/resources/css/css.jsp" />
    <h:body onload="init()" onunload="dispose()" styleClass="body_background">
        <f:view locale="#{frontController.user.locale}">        
            <div style="width:32px;height:32px;display:block;position:fixed;right:0;top:0;">

                <p:ajaxStatus id="status">
                    <f:facet name="start"><h:graphicImage value="/resources/images/loading.gif"/> </f:facet>
                    <f:facet name="success"><h:outputText value="" /></f:facet>
                    <f:facet name="error">An error has occurred!</f:facet>
                </p:ajaxStatus>

            </div>
            <div id="wraper" > 
                <h:form id="errorpage">
                    <h:commandButton id="submit" value="Submit" action="/sessionExpired" style="display:none" />
                    <h:inputHidden id="error" value="#{frontController.error}" />
                </h:form>
                <ui:include src="/sections/header.xhtml" />
                <script>
                    var curr_menuitem="<ui:insert name="menuitem"></ui:insert>";
                </script>        
                <div style="margin: 0; padding: 0" class="ui-panel-content ui-widget-content">
                    <h:form id="menu" prependId="false" style="margin: 0; padding: 0;width: 100%" > 
                        <p:menubar  >  
                            <p:menuitem value="#{bundle.Index}"  url="index.xhtml"    />  
                            <p:menuitem value="#{bundle.LookUp}" url="listAdv.xhtml"   />  
                            <p:menuitem value="#{bundle.Add}" url="addAdv.xhtml" />  
                            <p:menuitem value="#{bundle.FileManager}" url="fileManager.xhtml" />  
                        </p:menubar>
                    </h:form>
                </div>   
                <div class="ui-panel-content ui-widget-content">
                    <ui:insert name="body"></ui:insert>
                    <c:if  test="#{!frontController.islogedIn()}">
                        <ui:insert name="guest"></ui:insert>
                    </c:if>
                    <c:if test="#{frontController.islogedIn()}">
                        <ui:insert name="user"></ui:insert>
                    </c:if>
                </div>
            </div>
        </f:view>
    </h:body>
</html>
